package com.mobi.cacti.model;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import android.util.Log;

public class ReqTFASTicketHandler extends DefaultHandler {
	private String tempVal;
	private ReqTFASTicket oClass;

	public ReqTFASTicketHandler() {}

	public ReqTFASTicket getObj() {
		return oClass;
	}

	public void startElement(String uri, String localName, String qName,Attributes attributes) throws SAXException {
		// reset
		tempVal = "";
		if (localName.equalsIgnoreCase("ReqTFASTicket")) {
			oClass = new ReqTFASTicket();
		}
	}

	public void characters(char[] ch, int start, int length) throws SAXException {
		tempVal = new String(ch, start, length);
	}

	public void endElement(String uri, String localName, String qName) throws SAXException 
	{
		if (qName.equalsIgnoreCase("ReqSessionID")){
			oClass.ReqSessionID = tempVal;
		}else if (qName.equalsIgnoreCase("ResSessionID")){	
			oClass.ResSessionID = tempVal;
		}else if (qName.equalsIgnoreCase("Ticket_No")){
			oClass.Ticket_No = tempVal;
		}else if (qName.equalsIgnoreCase("Ticket_Status")){	
			oClass.Ticket_Status = tempVal;
		}else if (qName.equalsIgnoreCase("FaultType_Cd")){	
			oClass.FaultType_Cd = tempVal;
		}else if (qName.equalsIgnoreCase("FaultDate")){	
			oClass.FaultDate = tempVal;
		}else if (qName.equalsIgnoreCase("SLA")){	
			oClass.SLA = tempVal;
		}else if (qName.equalsIgnoreCase("Fault_Description")){	
			oClass.Fault_Description = tempVal;
		}else if (qName.equalsIgnoreCase("Symptom")){	
			oClass.Symptom = tempVal;
		}
	}

}
